﻿using FluentValidation;
using PMS.Data.Entities.Settings;
using PMS.Web.Framework.Validators;
using PMS.Web.Models.Customers;

namespace PMS.Web.Validators.Customer
{
    public partial class PasswordRecoveryConfirmValidator : BaseModelValidator<PasswordRecoveryConfirmModel>
    {
        public PasswordRecoveryConfirmValidator(CustomerSettings customerSettings)
        {
            RuleFor(x => x.NewPassword).IsPassword(customerSettings);
            RuleFor(x => x.ConfirmNewPassword).NotEmpty().WithMessage(ValidatorRuleString.Validation_PasswordNotEmpty);
            RuleFor(x => x.ConfirmNewPassword).Equal(x => x.NewPassword).WithMessage(ValidatorRuleString.Validation_ConfirmPasswordNotMatch);
        }
    }
}
